import axios from 'axios'

export default {
  post: (url, params) => {
    return new Promise((resolve, reject) => {
      axios.post(url, params)
     .then(res => {
         resolve(res);
     })
     .catch(err =>{
         reject(err)
     })
 });
  },
  get: (url, params) => {
    return new Promise((resolve, reject) =>{        
      axios.get(url, {            
          params: params        
      }).then(res => {
          resolve(res);
      }).catch(err =>{
          reject(err)        
      }) 
    });
  },
};